package com.appkubes.mall.restful.application.order.order.dao;

import com.appkubes.mall.core.dao.BaseMallOrderDao;
import com.appkubes.mall.restful.application.order.order.entity.dto.GetListOrderResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface OrderDao extends BaseMallOrderDao {

    @Select({"<script>",
            "SELECT " +
                    " o.* " +
                    " FROM `mall_order` o " +
                    " WHERE  ${queryStr} " +
                    " ORDER BY o.update_time DESC " +
                    " LIMIT #{page},#{limit}",
            "</script>"})
    List<GetListOrderResult> getList(@Param("queryStr") String queryStr,
                                     @Param("page") int page,
                                     @Param("limit") int limit);


}
